package cn.edu.zafu.bigdata.x.cxy;

public class Course {
    // 课程相关信息
    private final String courseName;      // 课程名称
    private final String courseCode;      // 课程编号
    private final double credits;            // 学分
    private final String teacher;      // 授课教师

    // 构造方法，用于创建课程对象
    public Course(String courseName, String courseCode, int credits, String teacher) {
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.credits = credits;
        this.teacher = teacher;
    }

    // 打印课程信息
    public void print() {
        System.out.println("课程信息:");
        System.out.println("课程名称: " + courseName);
        System.out.println("课程编号: " + courseCode);
        System.out.println("学分: " + credits);
        System.out.println("教师: " + teacher);
    }

    // 主函数用于测试Course类
    public static void main(String[] args) {
        Course javaCourse = new Course("java面向对象程序设计", "CS001", 4, "吴鹏");
        javaCourse.print();
    }
}
